<?
/**
 * 处理用户的更新信息请求
 *
 */
require_once( './path.php' );

//调用初始化页面
require_once( CLASSMATE_ROOT.'/controller/process_script_init.php' );

@$request = $_POST;

try{

if ( !session::get( 'is_online' ) ){
	
	$response_message = array( 'type'=>'info' , 
			'content'=>'你还没有登录，不能进行此操作。' , 
			'url_des'=>'马上登录去？' ,
			'url'=>'/classmate/controller/account/login.php' );
	session::set( 'response_message' , $response_message );

	header( 'Location: ../response_message.php' );
	exit();
}

$db_connect = mongo_connect();
$update = new update_user_profile_process( $db_connect , session::get( 'email' ) );

if ( $update->do_update( $request ) ){
	 
	 //更新成功
	 echo '更新成功';
}

}catch( Exception $e ){

	exit();
}
